﻿Imports System.ComponentModel

Public Class NotifyPropertyChanged
    Implements INotifyPropertyChanged


    Private _isDirty As Boolean

    Private _series As String

    Private _issue As String


    Public Sub New()

        SeriesTitle = ""

        IssueTitle = ""

        IsDirty = False

    End Sub


    Public Property SeriesTitle() As String

        Get

            Return _series

        End Get

        Set(ByVal value As String)

            _series = value

            OnPropertyChanged("SeriesTitle")

        End Set

    End Property


    Public Property IssueTitle() As String

        Get

            Return _series

        End Get

        Set(ByVal value As String)

            _series = value

            OnPropertyChanged("IssueTitle")

        End Set

    End Property


    Public Property IsDirty() As Boolean

        Get

            Return _isDirty

        End Get

        Private Set(ByVal value As Boolean)

            _isDirty = value

        End Set

    End Property


    Public Sub ResetDirtyBit()

        Me.IsDirty = False

    End Sub


    Public Sub OnPropertyChanged(ByVal propertyName As String)

        RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propertyName))

        IsDirty = True

    End Sub

    Public Event PropertyChanged(ByVal sender As Object, ByVal e As PropertyChangedEventArgs) Implements INotifyPropertyChanged.PropertyChanged

End Class
